def matches(dev, mode) :
    return dev == "wand" and mode == "fly"

def wand(self, dev, event) :
    import osg, math
    if event["mode"] == "analog" :
        self.velocity = osg.Matrixd()
        self.velocity.postMult(
            osg.Matrixd.translate(
                self.wand_matrix.getRotate() * osg.Vec3d(
                    0, 0, -event["data"][1] * self.nav_scale["translation"][1]
                )
            )
        )
        self.velocity.postMult(
            osg.Matrixd.rotate(
                -event["data"][0] * self.nav_scale["rotation"], 0, 1, 0
            )
        )
    elif event["mode"] == "button" and event["data"][0] == 5 :
        pass

